home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / SCROLLER.H < prev    next >
C/C++ Source or Header  |  1980-01-03  |  3KB  |  95 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * General scrolling interface.
  25.  */
  26.  
  27. #ifndef scroller_h
  28. #define scroller_h
  29.  
  30. #include <InterViews/interactor.h>
  31.  
  32. class Scroller : public Interactor {
  33. protected:
  34.     Interactor* interactor;
  35.     int size;
  36.     Perspective* view;
  37.     Perspective* shown;
  38.     double scale;
  39.     Sensor* tracking;
  40.     boolean syncScroll;
  41.  
  42.     Scroller(Interactor*, int);
  43.     Scroller(const char*, Interactor*, int);
  44.     Scroller(Interactor*, int, Painter* out);
  45.     ~Scroller();
  46.  
  47.     void Background(Coord, Coord, Coord, Coord);
  48.     void MakeBackground();
  49.     virtual void Resize();
  50. private:
  51.     void Init();
  52. };
  53.  
  54. class HScroller : public Scroller {
  55. public:
  56.     HScroller(Interactor*, int size = 0);
  57.     HScroller(const char*, Interactor*, int size = 0);
  58.     HScroller(Interactor*, int size, Sensor* in, Painter* out);
  59.  
  60.     virtual void Handle(Event&);
  61.     virtual void Update();
  62. private:
  63.     void Bar(Coord, int);
  64.     void Border(Coord);
  65.     void GetBarInfo(Perspective*, Coord&, int&);
  66.     void Init();
  67.     void Outline(Coord, int);
  68.     virtual void Reconfig();
  69.     virtual void Redraw(Coord, Coord, Coord, Coord);
  70.     void Sides(Coord, Coord);
  71.     Coord Slide(Event&);
  72. };
  73.  
  74. class VScroller : public Scroller {
  75. public:
  76.     VScroller(Interactor*, int size = 0);
  77.     VScroller(const char*, Interactor*, int size = 0);
  78.     VScroller(Interactor*, int size, Sensor* in, Painter* out);
  79.  
  80.     virtual void Handle(Event&);
  81.     virtual void Update();
  82. private:
  83.     void Bar(Coord, int);
  84.     void Border(Coord);
  85.     void GetBarInfo(Perspective*, Coord&, int&);
  86.     void Init();
  87.     void Outline(Coord, int);
  88.     virtual void Reconfig();
  89.     virtual void Redraw(Coord, Coord, Coord, Coord);
  90.     void Sides(Coord, Coord);
  91.     Coord Slide(Event&);
  92. };
  93.  
  94. #endif
  95.